class ParentClass:
    def say_hello(self):
        print("Hello from ParentClass")


class ChildClass(ParentClass):
    def say_hello(self):
        # 调用父类的 say_hello 方法
        super().say_hello()
        print("Hello from ChildClass")


child = ChildClass()
child.say_hello()



class ParentClass:
    def say_hello(self):
        print("Hello from ParentClass")


class ChildClass(ParentClass):
    def say_hello(self):
        print("Hello from ChildClass")


# 创建子类实例
child = ChildClass()
# 调用子类重写后的方法
child.say_hello()

# 创建父类实例
parent = ParentClass()
# 调用父类的方法
parent.say_hello()